From 5c89fad4283102c1d3b4781cb3e283d0e7302284 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 7 May 2010 10:02:14 +0100 Subject: [PATCH] domain_create: No need to zero new domain struct as done by arch-dep code Fix ia64 to always make this the case. Signed-off-by: Xiao Guangrong --- xen/arch/ia64/xen/domain.c | 9 +++++---- xen/common/domain.c | 1 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/arch/ia64/xen/domain.c b/xen/arch/ia64/xen/domain.c index 7e48b66d40..a15f940561 100644 --- a/xen/arch/ia64/xen/domain.c +++ b/xen/arch/ia64/xen/domain.c @@ -407,20 +407,21 @@ void relinquish_vcpu_resources(struct vcpu *v) struct domain *alloc_domain_struct(void) { -#ifdef CONFIG_IA64_PICKLE_DOMAIN struct domain *d; +#ifdef CONFIG_IA64_PICKLE_DOMAIN /* * We pack the MFN of the domain structure into a 32-bit field within * the page_info structure. Hence the MEMF_bits() restriction. */ d = alloc_xenheap_pages(get_order_from_bytes(sizeof(*d)), MEMF_bits(32 + PAGE_SHIFT)); +#else + d = xmalloc(struct domain); +#endif + if ( d != NULL ) memset(d, 0, sizeof(*d)); return d; -#else - return xmalloc(struct domain); -#endif } void free_domain_struct(struct domain *d) diff --git a/xen/common/domain.c b/xen/common/domain.c index 2cd867e814..2759972b76 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -223,7 +223,6 @@ struct domain *domain_create( if ( (d = alloc_domain_struct()) == NULL ) return NULL; - memset(d, 0, sizeof(*d)); d->domain_id = domid; lock_profile_register_struct(LOCKPROF_TYPE_PERDOM, d, domid, "Domain"); -- 2.30.2